﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class KaiguanController : MonoBehaviour {

    private Vector3 v_close = new Vector3(0,-90, -130);
    private Vector3 v_open = new Vector3(0, -90, 0);
    private bool b_isOpen;

    void OnMouseDown() {
        if (!b_isOpen)
        {
            transform.parent.localEulerAngles = v_open;
            b_isOpen = true;
            EventManager<bool>.TriggerEvent(MyEventType.SifangHeipingEvent,false);
        }
        else {
            transform.parent.localEulerAngles = v_close;
            b_isOpen = false;
            EventManager<bool>.TriggerEvent(MyEventType.SifangHeipingEvent, true);
        }   
    }
}
